import java.net.*;
import java.io.*;
public class TCPClient {
	public static void main(String [] args)throws Exception
	{
		Socket s=new Socket("127.0.0.1",8888);
		OutputStream os=s.getOutputStream();
		DataOutputStream dos=new DataOutputStream(os);
		DataInputStream dis=new DataInputStream(s.getInputStream());
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		String st=br.readLine();
		System.out.println(dis.readUTF());
		dos.writeUTF(st);
		dos.flush();
		dos.close();
		s.close();
	}

}
